package com.wdh.kjs.activity;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.util.Log;
import android.view.View;

import com.wdh.kjs.R;
import com.wdh.kjs.fragment.Fragement_InvestManage_Success;
import com.wdh.kjs.fragment.Invest_manage_Fragment;
import com.wdh.kjs.widget.MyTabView;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;


/**
 * Created by CQH on 2016/4/21.
 */
public class InvestManageActivity2 extends BaseTopActivity implements View.OnClickListener {

    private MyTabView tab_investmanage;
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_investmanage);
        initTopBar("投资管理");
        initView();
    }

    public void initView(){
        tab_investmanage = (MyTabView)findViewById(R.id.tab_investmanage);
        Log.i("msg","111");

        List<Map<String, Integer>> titles = new ArrayList<>();
        Map<String, Integer> map = new HashMap<>();
        map.put("投资记录", null);
        titles.add(map);

        map = new HashMap<>();
        map.put("募集中项目", null);
        titles.add(map);

        map = new HashMap<>();
        map.put("募集成功项目", null);
        titles.add(map);

        map = new HashMap<>();
        map.put("募集终止项目", null);
        titles.add(map);

        List<Fragment> fragments = new ArrayList<>();
        Invest_manage_Fragment Fm_financemanage_Fragment = new Invest_manage_Fragment();
        Fm_financemanage_Fragment.QUERY_TYPE = 0;
        fragments.add(Fm_financemanage_Fragment);

        Invest_manage_Fragment Im_raising_Fragment = new Invest_manage_Fragment();
        Im_raising_Fragment.QUERY_TYPE = 1;
        fragments.add(Im_raising_Fragment);

        Invest_manage_Fragment Im_raisesuccess_Fragment = new Invest_manage_Fragment();
        Im_raisesuccess_Fragment.QUERY_TYPE = 2;
        fragments.add(Im_raisesuccess_Fragment);

//        Fragement_InvestManage_Success Im_raisesuccess_Fragment = new Fragement_InvestManage_Success();
//        fragments.add(Im_raisesuccess_Fragment);

        Invest_manage_Fragment Im_raisestop_Fragment = new Invest_manage_Fragment();
        Im_raisestop_Fragment.QUERY_TYPE = 3;
        fragments.add(Im_raisestop_Fragment);

        tab_investmanage.createView(titles, fragments, getSupportFragmentManager());
    }

    @Override
    public void onClick(View view) {

    }
}
